//
//  FPMyTableHeadView.m
//  FilmParadise
//
//  Created by lanou3g on 15/7/22.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//

#import "FPMyTableHeadView.h"

@implementation FPMyTableHeadView
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithRed:0.180 green:0.596 blue:1.000 alpha:1.000];
        
        
        self.personBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        self.personBtn.tag = 700;
        [self.personBtn addTarget:self action:@selector(DidClickButton:) forControlEvents:UIControlEventTouchUpInside];
        self.personBtn.frame = CGRectMake(kImageW(20), kImageH(20), kImageW(70), kImageH(70));
        self.personBtn.layer.masksToBounds = YES;
        [self.personBtn setBackgroundImage:[UIImage imageNamed:@"person"] forState:UIControlStateNormal];
        self.personBtn.layer.cornerRadius = kImageW(20);
        [self addSubview:_personBtn];
        
        self.userName = [[UILabel alloc]initWithFrame:CGRectMake(_personBtn.x + _personBtn.width +kImageW(20), _personBtn.y, kImageW(250), kImageH(30))];
        self.userName.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:22];
        [self addSubview:_userName];
        
        
        
        self.loginBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        self.loginBtn.tag = 701;
        [self.loginBtn addTarget:self action:@selector(DidClickButton:) forControlEvents:UIControlEventTouchUpInside];

        self.loginBtn.frame = CGRectMake(_personBtn.x + _personBtn.width +kImageW( 50), _personBtn.y + kImageH(40), kImageW(60), kImageH(30));
        [self.loginBtn setTintColor: [UIColor purpleColor]];
        self.loginBtn.titleLabel.font = [UIFont systemFontOfSize:20];
        [self.loginBtn setTitle:@"登录" forState:UIControlStateNormal];
        [self addSubview:_loginBtn];
        
        self.signinBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        self.signinBtn.tag = 702;
        [self.signinBtn addTarget:self action:@selector(DidClickButton:) forControlEvents:UIControlEventTouchUpInside];

        self.signinBtn.frame = CGRectMake(_loginBtn.x + _loginBtn.width + kImageW(50), _loginBtn.y, _loginBtn.width , _loginBtn.height);
        self.signinBtn.titleLabel.font = [UIFont systemFontOfSize:20];
        [self.signinBtn setTintColor: [UIColor purpleColor]];
        [self.signinBtn setTitle:@"注册" forState:UIControlStateNormal];
        [self addSubview:_signinBtn];
        
        
        
    }
    return self;
}

- (void)DidClickButton:(UIButton *)button ;
{
    [self.delegate TableHeadView:self didClicButton:button];
     }
@end
